<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../../ht-css/operate/operate.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title></title>
</head>
<body data-id="573">
<nav class="breadcrumb">运营管理 <span class="c-gray en">&gt;</span> 移动端管理 <span class="c-gray en">&gt;</span> 首页管理 <span class="c-gray en"> <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></span></nav>
<article class="page-container">
    <form class="ml-20 mr-20 bg-1 pt-20 pb-20 clearfix">
        <div class="visualizing_left" id="tab_topnav">
            <div class="tab clearfix tabBars">
                <span class="hover" id="ordinary" onclick="ordinarySwitchs(20)">普通</span>
                <span id="signing" onclick="ordinarySwitchs(10)">签约</span>
            </div>
            <!--普通-->
            <div class="visualizing_lbox circle_banner_all  taball">
                <div class="arrow btn_prev"></div>
                <div class="arrow btn_next"></div>
                <ul class="circle_tab" id="serialNumber">

                </ul>
                <ul class="circle_banner" id="rotationCharts">

                </ul>
            </div>
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../ht-js/access/account.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/power.js?rev=@@hash"></script>
<script>
    var xuhao =""
    var i=0,timer;
    var sum = 0;
    //切换普通
    ordinarySwitchs(20)
    function ordinarySwitchs(val){
        $('#rotationCharts').html("");
        $('#serialNumber').html("");
        i=0
        var platforms=""
        if(val==20){
            //普通
            $("#signing").removeAttr("class")
            $("#ordinary").attr("class","hover")
            platforms=20
        }else {
            //签约
            $("#ordinary").removeAttr("class")
            $("#signing").attr("class","hover")
            platforms=10
        }

        $.ajax({
            url: root.appversioncontrol.listWheelPictureBack,
            cache: false,  //禁用缓存
            type: "POST",
            dataType:'json',
            contentType: "application/json",
            data: JSON.stringify({
                "pageNum":1,
                "pageSize":10,
                "platform": platforms,//平台
                "picStatus":10
            }),
            success: function (data) {
                var rotationChart = '';

                if(data.data!=null&&data.data!=""){
                    if(data.data.data!=null&&data.data.data!=""){
                        //图片序号
                        var coner=data.data.data.length+1//当前列表条数
                        xuhao=data.data.data.length
                        var serialNumbers=""
                        if(data.data.data.length==1){
                            serialNumbers=''
                            $('.arrow').css({
                                display: "none"
                            });
                        }else {
                            $('.arrow').css({
                                display: "inline"
                            });
                            for(var i=1; i<coner; i++){
                                if(Number(i)==1){
                                    serialNumbers += '<li class="hover">';
                                    serialNumbers+=''+Number(i)+''
                                    serialNumbers += '</li>';
                                }else {
                                    serialNumbers += '<li>';
                                    serialNumbers+=''+Number(i)+''
                                    serialNumbers += '</li>';
                                }


                            }
                        }
                        for (var k = 0; k < data.data.data.length; k++){
                            rotationChart += '<li>';
                            rotationChart+='<img src="' + data.data.data[k].picUrl + '" onclick="jumpPage(\'轮播图编辑\',\'moban.html\','+platforms+','+data.data.data[k].picId+')">'
                            rotationChart += '</li>';
                        }

                        $('#serialNumber').html(serialNumbers);
                    }else {
                        $('.arrow').css({
                            display: "none"
                        });
                        rotationChart += '<li>';
                        rotationChart+='<img src="../../../img/blank.png" onclick="jumpPage(\'轮播图编辑\',\'moban.html\','+platforms+')">'
                        rotationChart += '</li>';
                    }

                }else {
                    $('.arrow').css({
                        display: "none"
                    });
                    rotationChart += '<li>';
                    rotationChart+='<img src="../../../img/blank.png" onclick="jumpPage(\'轮播图编辑\',\'moban.html\','+platforms+')">'
                    rotationChart += '</li>';
                }
                $('#rotationCharts').html(rotationChart);

                sum = $("#rotationCharts li").length;

                $('#rotationCharts').find('li').eq(0).show().siblings().hide();

            },
            error: function () {
                $.Huimodalalert('失败！',2000);
            }
        });
    }

    $(function(){
        $(".circle_banner li").eq(0).show();
        $(".circle_banner_all").hover(function(){
            clearInterval(timer);
        })

        $(".arrow").hover(function(){
            clearInterval(timer);
        });
        /*左箭头控制轮播*/
        $(".btn_prev").click(function(){
            clearInterval(timer);
            if(i==0){
                i=sum;
            }
            i--;
            startLunbo();
        });

        /*右箭头控制轮播*/
        $(".btn_next").click(function(){
            clearInterval(timer);
            if(i==sum-1){
                i=-1;
            }
            i++;
            startLunbo();
        });

        /*提示信息变换*/
        // $(".circle_tab>li").hover(function(){
        //     clearInterval(timer);
        //     i=$(this).index();
        //     console.log(i);
        //     startLunbo();
        // });

        $('#serialNumber').on('mouseover','li',function (){
            clearInterval(timer);
            var curId = $(this).index();
            $(this).addClass('hover').siblings().removeClass();
            $('#rotationCharts').find('li').eq(curId).show().siblings().hide();
        })

    });

    /*图片轮播和提示信息*/
    function startLunbo(){
        console.log(i);
        if(i>=sum){
            i=0;
        }
        $(".circle_banner>li").eq(i).show().siblings().hide();
        $(".circle_tab>li").eq(i).addClass("hover").siblings().removeClass("hover");
    }


    /*跳转详情*/
    function jumpPage(title,url,data,editpicId){
        sessionStorage.setItem("platforms",data);
        sessionStorage.setItem("editpicIds",editpicId)
        sessionStorage.removeItem("listReturn");
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }
</script>
</body>
</html>